package com.hello.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hello.common.core.annotation.Excel;
import com.hello.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 聊天消息记录对象 sd_chat_messages
 * 
 * @author hello
 * @date 2025-05-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ChatMessages extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 消息ID，主键，自增 */
    private Long messageId;

    /** 会话ID，不能为空 */
    @Excel(name = "会话ID，不能为空")
    private String sessionId;

    /** 发送者ID，可以是用户ID或AI/系统ID */
    @Excel(name = "发送者ID，可以是用户ID或AI/系统ID")
    private String senderId;

    /** 发送者类型：用户、AI或系统 */
    @Excel(name = "发送者类型：用户、AI或系统")
    private String senderType;

    /** 消息内容，不能为空 */
    @Excel(name = "消息内容，不能为空")
    private String content;

    /** 消息类型，默认为文本 */
    @Excel(name = "消息类型，默认为文本")
    private String messageType;

    /** 时间戳 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "时间戳", width = 30, dateFormat = "yyyy-MM-dd")
    private Date timestamp;

    /** 已读时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "已读时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date readAt;

    public void setMessageId(Long messageId) 
    {
        this.messageId = messageId;
    }

    public Long getMessageId() 
    {
        return messageId;
    }
    public void setSessionId(String sessionId) 
    {
        this.sessionId = sessionId;
    }

    public String getSessionId() 
    {
        return sessionId;
    }
    public void setSenderId(String senderId) 
    {
        this.senderId = senderId;
    }

    public String getSenderId() 
    {
        return senderId;
    }
    public void setSenderType(String senderType) 
    {
        this.senderType = senderType;
    }

    public String getSenderType() 
    {
        return senderType;
    }
    public void setContent(String content) 
    {
        this.content = content;
    }

    public String getContent() 
    {
        return content;
    }
    public void setMessageType(String messageType) 
    {
        this.messageType = messageType;
    }

    public String getMessageType() 
    {
        return messageType;
    }
    public void setTimestamp(Date timestamp) 
    {
        this.timestamp = timestamp;
    }

    public Date getTimestamp() 
    {
        return timestamp;
    }
    public void setReadAt(Date readAt) 
    {
        this.readAt = readAt;
    }

    public Date getReadAt() 
    {
        return readAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("messageId", getMessageId())
            .append("sessionId", getSessionId())
            .append("senderId", getSenderId())
            .append("senderType", getSenderType())
            .append("content", getContent())
            .append("messageType", getMessageType())
            .append("timestamp", getTimestamp())
            .append("readAt", getReadAt())
            .toString();
    }
}
